package view.GUI.adminView.coreData.people.customer;

import javafx.stage.Stage;
import enums.GUIText;
import enums.PaymentType;
import enums.Status;
import view.GUI.mainView.MainView;
import model.data.tableModel.person.Customer;

public final class NewCustomer extends CustomerView {

	public NewCustomer(MainView instance) {
		super(false, GUIText.NEWCUSTOMER, instance);
		try {
			start(new Stage());
		} catch (Exception e) {
			log.error(e.getMessage());
			e.printStackTrace();
		}
	}

	@Override
	protected boolean save() {

		Customer.createNew(txtCustomerName.getText(), PaymentType.INVOICE, Status.ACTIVE, cmbPerson.getSelectionModel()
				.getSelectedItem());
		return true;
	}
}
